import java.awt.Point;
import java.util.ArrayList;

public class Zombie extends Agent {

	int fullEnergy = 20;
	
	private static long lastId;

	
	public Zombie(Point p) {

		super(p);
		lastId++;
		setId(lastId);
	}

	@Override
	public MapObjectType getType() {
		return MapObjectType.Zombie;
	}

	@Override
	public void makeMove() {
		Action a = getProvider().decide();
		if (a.getEvokerType() == MapObjectType.Zombie) {
			switch (a.getName()) {
			case "move":
				if (a.getDirection() != null) {
					this.move(a.getDirection());
				} else {
					System.err.println("move action requires direction");
				}
				break;
			case "replenish":

				this.replenish();

				break;
			case "attack":
			{
				this.fight(a.getTargetId()); //?
			}
				break;
			default:
				System.err
						.println("no " + a.getName() + " action for zombie");
				break;
			}
		} else if(a.getEvokerType()==MapObjectType.NO_OBJECT){
			// TODO
		} else {
			System.err.println("cannot decide for "
					+ a.getEvokerType());
		}
		if (Main.isPrintKnowledge()) {
		};

		
	}

	public boolean isEnemy(MapObject wo) {
		Agent agent = (Agent) wo;
		if(agent.getType() != MapObjectType.Zombie)
			return true;
		else
			return false;
	}
}
